package com.idc.common.constant;

public class EncryptionConstant {

	public static final char[] ECB_CHARS = new char[] { 'E', 'C', 'B' };

	public static final char[] CBC_CHARS = new char[] { 'C', 'B', 'C' };

	public static final char[] GCM_CHARS = new char[] { 'G', 'C', 'M' };

	public static final char[] AES_CHARS = new char[] { 'A', 'E', 'S' };

	public static final char[] RSA_CHARS = new char[] { 'R', 'S', 'A' };

	public static final char[] DES_CHARS = new char[] { 'D', 'E', 'S' };

	public static final char[] MD5_CHARS = new char[] { 'M', 'D', '5' };

	public static final String CIPHER_ALGORITHM_ECB;
	public static final String CIPHER_ALGORITHM_ECB_NOPAD;
	public static final String CIPHER_ALGORITHM_CBC;
	public static final String CIPHER_ALGORITHM_GCM;
	public static final String AES_CONSTANT;
	public static final String DES_CONSTANT;
	public static final String MD5_CONSTANT;
	public static final String RSA_CONSTANT;
	public static final String RSA_ALGORITHM_PADDING;
	public static final String DES_CIPHER_ALGORITHM_CBC;
	
	static {
		// ======================================
		// AES/ECB/PKCS5Padding
		StringBuilder sb = new StringBuilder();
		sb.append("AES/");
		for (char c : ECB_CHARS) {
			sb.append(c);
		}
		sb.append("/PKCS5Padding");
		CIPHER_ALGORITHM_ECB = sb.toString();
		// ======================================
		// AES/ECB/NoPadding
		sb.setLength(0);
		sb.append("AES/");
		for (char c : ECB_CHARS) {
			sb.append(c);
		}
		sb.append("/NoPadding");
		CIPHER_ALGORITHM_ECB_NOPAD = sb.toString();
		// ======================================
		// AES/CBC/PKCS5Padding
		sb.setLength(0);
		sb.append("AES/");
		for (char c : CBC_CHARS) {
			sb.append(c);
		}
		sb.append("/PKCS5Padding");
		CIPHER_ALGORITHM_CBC = sb.toString();
		// ======================================
		// AES/GCM/PKCS5Padding
		sb.setLength(0);
		sb.append("AES/");
		for (char c : GCM_CHARS) {
			sb.append(c);
		}
		sb.append("/PKCS5Padding");
		CIPHER_ALGORITHM_GCM = sb.toString();
		// ======================================
		// AES
		sb.setLength(0);
		for (char c : AES_CHARS) {
			sb.append(c);
		}
		AES_CONSTANT = sb.toString();
		// ======================================
		// DES
		sb.setLength(0);
		for (char c : DES_CHARS) {
			sb.append(c);
		}
		DES_CONSTANT = sb.toString();
		// ======================================
		// RSA
		sb.setLength(0);
		for (char c : RSA_CHARS) {
			sb.append(c);
		}
		RSA_CONSTANT = sb.toString();
		// ======================================
		// RSA/ECB/PKCS1Padding
		sb.setLength(0);
		sb.append("RSA/");
		for (char c : ECB_CHARS) {
			sb.append(c);
		}
		sb.append("/PKCS1Padding");
		RSA_ALGORITHM_PADDING = sb.toString();
		// ======================================
		// DES/CBC/PKCS5Padding
		sb.setLength(0);
		sb.append("DES/");
		for (char c : CBC_CHARS) {
			sb.append(c);
		}
		sb.append("/PKCS5Padding");
		DES_CIPHER_ALGORITHM_CBC = sb.toString();
		// ======================================
		// RSA
		sb.setLength(0);
		for (char c : MD5_CHARS) {
			sb.append(c);
		}
		MD5_CONSTANT = sb.toString();
	}

	// public static void main(String[] args) {
	// java.util.List<String> list = new java.util.ArrayList<String>();
	// list.add(CIPHER_ALGORITHM_ECB);
	// list.add(CIPHER_ALGORITHM_ECB_NOPAD);
	// list.add(CIPHER_ALGORITHM_CBC);
	// list.add(CIPHER_ALGORITHM_GCM);
	// list.add(AES_CONSTANT);
	// list.add(DES_CONSTANT);
	// list.add(MD5_CONSTANT);
	// list.add(RSA_CONSTANT);
	// list.add(RSA_ALGORITHM_PADDING);
	// list.add(DES_CIPHER_ALGORITHM_CBC);
	// list.forEach(it -> System.out.println(it));
	// }
}
